<?php

require_once 'Zend/Filter/Interface.php';

abstract class Zend_Filter_Unix_Abstract implements Zend_Filter_Interface
{
    protected function _parseLines($value)
    {
        $lines = preg_match_all('/^.*(\r\n|\r|\n)?/m', $value, $matches);
        return $matches[0];
    }

    protected function _parseWords($value)
    {
        $words = preg_split('/(\s)/', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
        if(empty($words[count($words) - 1])) {
            array_pop($words);
        }

        return $words;
    }
}